package com.sunni.mapper;

import com.sunni.entity.Role;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMapper {

    /*day16-07 : 多对多   封装roleList*/
    @Select("select r.* from sys_role r, sys_employee_role er where r.id=er.rid and er.eid=#{eid}")
    @Results({
            @Result(id = true,property = "id",column = "id"),
            @Result(property = "roleName",column = "role_name"),
            @Result(property = "roleDesc",column = "role_desc")
    })
    List<Role> selectByEmployeeId(Integer eid);
}
